<div [formGroup]="group" class="input-group">

    <input bsDatepicker class="form-control" #bsDatepicker="bsDatepicker"
           [autofocus]="model.autoFocus"
           [bsConfig]="model.getAdditional('bsConfig', {containerClass: model.getAdditional('containerClass', 'theme-green'), showWeekNumbers: model.getAdditional('showWeekNumbers', true)})"
           [datesDisabled]="model.getAdditional('datesDisabled', [])"
           [daysDisabled]="model.getAdditional('daysDisabled', [])"
           [formControlName]="model.id"
           [id]="id"
           [maxDate]="model.max"
           [minDate]="model.min"
           [name]="model.name"
           [ngClass]="getClass('element', 'control')"
           [outsideClick]="model.getAdditional('outsideClick', true)"
           [outsideEsc]="model.getAdditional('outsideEsc', true)"
           [placeholder]="model.placeholder"
           [placement]="model.getAdditional('placement', 'bottom')"
           [readonly]="model.readOnly"
           [required]="model.required"
           (bsValueChange)="onChange($event)"
           (onHidden)="onCustomEvent($event, 'onHidden')"
           (onShown)="onCustomEvent($event, 'onShown')">

    <div *ngIf="model.toggleIcon || model.toggleLabel" class="input-group-append">

        <button *ngIf="model.toggleIcon"
                class="btn input-group-text" type="button"
                (click)="bsDatepicker.toggle()"><img [src]="model.toggleIcon"/></button>
        <button *ngIf="model.toggleLabel"
                class="btn input-group-text" type="button"
                (click)="bsDatepicker.toggle()">{{ model.toggleLabel }}</button>

    </div>

</div>
